package com.yt.app.api.vo;

import com.yt.app.core.model.UserReport;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * Description
 * <p>
 * </p>
 * DATE 2017/11/15.
 *
 * @author liujunshi.
 */
@ApiModel(value = "UserReportVo", description = "用户体检报告")
public class UserReportVo implements Serializable{
    @ApiModelProperty(value = "id")
    private Long id;
    @ApiModelProperty(value = "用户ID")
    private Long uid;
    @ApiModelProperty(value = "机构名称")
    private String institution;
    @ApiModelProperty(value = "报告日期")
    private Integer reportDate;
    @ApiModelProperty(value = "图片文件，多个文件逗号分割")
    private List<ReportImageVo> files;
    @ApiModelProperty(value = "上传日期")
    private Long uploadDate;
    @ApiModelProperty(value = "备注")
    private String comments;

    public UserReportVo(UserReport report){
        this.id = report.getId();
        this.uid = report.getUid();
        this.institution = report.getInstitution();
        this.reportDate = report.getReportDate();
        this.uploadDate = report.getUploadDate();
        this.comments = report.getComments();
        String[] files = report.getFiles().split(",");
        this.files = new ArrayList<ReportImageVo>();
        for(String file : files){
            this.files.add(new ReportImageVo(file));
        }
    }
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public String getInstitution() {
        return institution;
    }

    public void setInstitution(String institution) {
        this.institution = institution;
    }

    public Integer getReportDate() {
        return reportDate;
    }

    public void setReportDate(Integer reportDate) {
        this.reportDate = reportDate;
    }

    public List<ReportImageVo> getFiles() {
        return files;
    }

    public void setFiles(List<ReportImageVo> files) {
        this.files = files;
    }

    public Long getUploadDate() {
        return uploadDate;
    }

    public void setUploadDate(Long uploadDate) {
        this.uploadDate = uploadDate;
    }

    public String getComments() {
        return comments;
    }

    public void setComments(String comments) {
        this.comments = comments;
    }

}
